<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>

<html>
    <head>

        <script type="text/javascript" language="javascript" src="../scripts/jQuery/confirm.js"></script>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jquery.fancybox-1.3.4.pack.js"></script>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jq.date.js"></script>
        <link rel="stylesheet" type="text/css" href="../css/ui.datepicker.css"/>
        <link rel="stylesheet" type="text/css" href="../css/thickbox.css"/>
        <link rel="stylesheet" type="text/css" href="../css/paging.css"/>
        <link rel="stylesheet" type="text/css" href="../css/richTable.css"/>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/thickbox.js"></script>
        <script type="text/javascript" language="javascript">
            var open_cur = 0;
            $j = jQuery.noConflict();
            var pt950A = 0;
            $j(document).ready(function(){
                
                var pt950ii = '<c:out value="${T950Bean.pt950}"/>';
         
                $j('.predebt').live('click',function(){
                    var pt950 = $j(this).attr('lang'); 
                    pt950ii =0;
                    $j('.debtContent').slideUp();
                    $j('.debtContent').html(''); 
                    var debt = $j(this).parent().parent().next().find('.debtContent');                    
                    if(debt.hasClass('active')){
                        debt.removeClass('active');
                    }else{
                                                 
                        debt.removeClass('active');
                        debt.addClass('active');                                               
                        showPleaseWait();
                        $j.post('predebt.jsp?action=predebt&ft950='+pt950,function(data){                      
                            if(data !=null){
                                //                                alert(sms.attr('class'));
                                debt.css('min-height','50px');
                                debt.html(data);
                                debt.slideDown();
                                hidePleaseWait();
                            }
                        });

                     
                    }
                });
               
                $j('.predebt'+pt950ii).live('click',function(){
                    //   alert("lan 1");
                    var pt950 = $j(this).attr('lang'); 
                   
                    $j('.debtContent').slideUp();
                    $j('.debtContent').html(''); 
                    var debt = $j(this).parent().parent().next().find('.debtContent');                    
                    if(debt.hasClass('active')){
                        debt.removeClass('active');
                    }else{
                                                 
                        debt.removeClass('active');
                        debt.addClass('active');                                               
                        showPleaseWait();
                        $j.post('predebt.jsp?action=predebt&ft950='+pt950,function(data){                      
                            if(data !=null){
                                //                                alert(sms.attr('class'));
                                debt.css('min-height','50px');
                                debt.html(data);
                                debt.slideDown();
                                hidePleaseWait();
                            }
                        });                    
                    }
                });
                if(pt950ii!=0){
                    $j('.predebt'+pt950ii).trigger("click");
                }

                $j('input#dateStart,input#dateStart1, input#dateEnd').datepicker({ dateFormat: 'dd/mm/yy', showOn: 'button', buttonImage: '../images/calenda_icon.gif', buttonImageOnly: true }); 
                $j('.keysearch').live('keyup',function(){
                   
                    if($j('.keysearch').val() == ""){
                        $j('.table_row').show();
                                   
                    }else{
                        $j('.table_row').hide();
                        $j('.table_row').each(function(){
                            html = $j(this).html();
                            if(   ununicode(html).indexOf(  ununicode($j('.keysearch').val()) ) > -1    )  {
                                $j(this).show();
                            }else{
                                $j(this).hide();
                            }
                        });
                    }

                });
                
                
                $j('.feild_sex').live('click',function(){
                    if(document.forms['financial']['financial:go'][0].checked == true ){
                        $j('.add').hide();
                    }
                    if(document.forms['financial']['financial:go'][2].checked == true ){
                        $j('.add').show();
                             
                    }
                });
                
                $j('.buttonsearch').live('click',function(){
                    $j('.group').show();
                    $j('.closeGroup').show();
                    
                });
                $j('.closeGroup').live('click',function(){
                    $j('.group1').hide();
                    $j(this).parent().hide();
                  
                });
                $j('#group-close').live('click', function(){
                    window.location.href="debt.jsp";
                });
                // $j(".rich-table-row:odd").addClass("odd");

            });
                    
        </script>
        <script type="text/javascript">
            $j(document).ready(function(){
                initThickBox('.thickbox');
                $j('.search_box').hide();       
                $j('.sidebar_search').live('click',function(){
                    $j('.search_box').hide();
                    if($j(this).next().hasClass('active')){

                        $j('.search_box').removeClass('active');
                    }else{

                        $j('.search_box').removeClass('active');
                        $j(this).next().addClass('active');
                        $j(this).next().show();
                    }
                });
            });
            
        </script>


    </head>


    <body>

        <a4j:form id="financial">
            <f:loadBundle basename="#{environmentSession.localizationSource}" var="locale"/>
            <h:outputText value="<div class='permission' lang='#{loginSession.right.MNU_DEB_VIE}'></div>" escape="false"/>
            <div id="content">
                <div id="menu_top">
                    <div class="dropdown">
                        <div class="select_choise">
                            <a href="#"><span>Khu vực</span></a>
                        </div>
                        <div class="select_hidden">
                            <ul>

                                <li><a href="#"><span>Filter Cấp 3</span></a></li>
                                <li><a href="#"><span>Filter Cấp 3</span></a></li>
                            </ul>
                        </div>
                    </div>
                    <div class="dropdown">
                        <div class="select_choise">
                            <a href="#"><span>Outlets</span></a>
                        </div>
                        <div class="select_hidden">
                            <ul>
                                <li><a href="#"><span>Ban Ðiều Hành</span></a></li>
                                <li><a href="#"><span>Nhóm IT</span></a></li>
                                <li><a href="#"><span>Filter Cấp 3</span></a></li>
                            </ul>
                        </div>
                    </div>
                </div>
                <div id="content_detail">
                    <div class="fast_search" style="margin-top:-26px;margin-left:653px;">
                        <h:inputText value="#{T950Bean.keysearch}" onfocus="if(this.value=='#{T950Bean.keysearch}')this.value='';" styleClass="keysearch"  />
                        <div  style="margin-left:5px; float:left;" class="buttonsearch">
                            <div class="group2"><div id="group-close" class="closeGroup">X&nbsp;&nbsp;</div></div>
                            <div class="group1">
                                <div class="group cssgroup" style="">

                                    <h:selectOneRadio id="go" layout="pageDirection" value="#{T950Bean.typesearch}" styleClass="feild_sex"  style="margin-left:5px; margin-top:4px; padding:15px; width:195px; height:150px;"   >
                                        <f:selectItem itemValue="1" itemLabel="#{locale.all}" />
                                        <f:selectItem itemValue="2" itemLabel="Họ tên"/>
                                        <f:selectItem itemValue="3"  itemLabel="Thu (TM/CK)"/>
                                        <f:selectItem itemValue="4" itemLabel="Chi (TM/CK)"/>
                                        <f:selectItem itemValue="5" itemLabel="Thu (Tạm ứng)"/>                                  
                                        <f:selectItem itemValue="6" itemLabel="Chi (Tạm ứng)"/>
                                        <f:selectItem itemValue="7" itemLabel="Mã tour"/>
                                    </h:selectOneRadio>  
                                    <div class="add">
                                        <div class="date">
                                            <input value="<h:outputText value=""><f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText>" type="text" id="dateStart" name="dateStart" class="input_fields date" /></br>
                                            </div>
                                            <div class="date1">
                                                <input value="<h:outputText value=""><f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText>" type="text" id="dateEnd" name="dateEnd" class="input_fields date" />
                                            </div>
                                        </div>
                                    <h:commandButton action="#{T950Bean.reload}" styleClass="buttonsearch2" value="#{locale.search}"/>

                                </div>  
                            </div>
                        </div>
                    </div>
                    <!-- end text search-->
                    <!-- start sidebar sidebar_row1--->
                    <div class="sidebar_row2">

                        <div class="sidebar">
                            <div class="sidebar_search">
                                <span> <h:outputText value="#{locale.search}"/></span>
                            </div>
                            <div class="search_box" style="display:none;">
                                <form action="" method="get">
                                    <h3><h:outputText value="#{locale.search}"/></h3>
                                    <div class="fields_input">
                                        <input name="" type="text"  value="<h:outputText value="#{locale.search_key}"/>..." onblur="if(this.value=='')this.value='<h:outputText value="#{locale.search_key}"/>...';" onfocus="if(this.value=='<h:outputText value="#{locale.search_key}"/>...')this.value='';" />
                                        <input name="" type="submit" value="OK" />
                                    </div>
                                </form>
                                <h4><h:outputText value="#{locale.advance_search}"/></h4>
                                <div class="fields_select">
                                    <select name="">
                                        <option><h:outputText value="#{locale.group}"/> / <h:outputText value="#{locale.Departments}"/></option>
                                    </select>
                                </div>
                                <div class="fields_select">
                                    <select name="">
                                        <option><h:outputText value="#{locale.sex}"/>...</option>
                                    </select>
                                </div>
                                <div class="fields_select">
                                    <select name="">
                                        <option><h:outputText value="#{locale.position}"/>...</option>
                                    </select>
                                </div>
                                <div class="fields_select">
                                    <select name="">
                                        <option><h:outputText value="#{locale.income}"/>...</option>
                                    </select>
                                </div>
                                <div class="fields_submit">
                                    <input name="" type="submit" value="<h:outputText value="#{locale.search_option}"/>" />
                                </div>
                            </div>
                        </div>

                    </div>

                    <!-- end sidebar row2--->

                    <div class="fillter">
                        <div class="dropdown">
                            <div class="select_choise ">


                                <div ><a href="debt.jsp"><span><h:outputText value="Danh sách công nợ"/></span></a></div>


                            </div>
                            <div class="select_hidden">
                                <ul>

                                    <li>
                                        <div><a href="listTour.jsp"><span><h:outputText value="#{locale.listTour}"/></span></a></div>

                                    </li>


                                </ul>
                            </div>
                        </div>
                    </div>
                    <div class="content_right" style="margin-top:15px;">
                        <h:panelGroup rendered="#{T950Bean.idtype ==0}">
                            <div style="height: 29px;background-color: #4A5763;width: 100%;line-height: 29px;">
                                <div style="margin-left: 15px;color: white;">
                                    <h:outputText value="DANH SÁCH CÔNG NỢ" style="text-transform:uppercase"/>
                                </div>

                            </div>
                        </h:panelGroup>
                        <h:panelGroup rendered="#{T950Bean.idtype !=0}">
                            <div style="height: 29px;background-color: #4A5763;width: 100%;line-height: 29px;">
                                <div style="margin-left: 15px;color: white;">
                                    <h:outputText value="DANH SÁCH KHÁCH HÀNG" style="text-transform:uppercase"/>
                                </div>

                            </div>
                        </h:panelGroup>
                        <div class="content_table">
                            <h:panelGroup rendered="#{T950Bean.idtype==0}">
                                <div class="rich_table viewTable" id="tableData">
                                    <%-- header --%>
                                    <table>
                                        <tr class="table_thead">
                                            <td class="table_subheadercell" style="width:40px "><h:outputText value="Chi tiết" escape="false"/></td>
                                            <td class="table_subheadercell" style="width:42px "><h:outputText value="Sửa" escape="false"/></td>
                                            <td class="table_subheadercell" style="width:60px "><h:outputText value="Chức năng" escape="false"/></td>
                                            <td class="table_subheadercell" style="width:50px "><h:outputText value="Tài liệu" escape="false"/></td>
                                            <td class="table_subheadercell" style="width:60px "><h:outputText value="Kiểm duyệt" escape="false"/></td>
                                            <td class="table_subheadercell" style="width:70px "><h:outputText value="Loại giao dịch" escape="false"/></td>
                                            <td class="table_subheadercell" style="width:100px "><h:outputText value="Mã tour" escape="false"/></td>
                                            <td class="table_subheadercell" style="width:100px "><h:outputText value="Tổng chi phí" escape="false"/></td>
                                            <td class="table_subheadercell" style="width:50px "><h:outputText value="Tiền tệ" escape="false"/></td>
                                            <td class="table_subheadercell" style="width:140px "><h:outputText value="Họ tên" escape="false"/></td>
                                            <td class="table_subheadercell" style="width:140px "><h:outputText value="Hóa đơn" escape="false"/></td>
                                            <td class="table_subheadercell" style="width:140px "><h:outputText value="Số Seri" escape="false"/></td>
                                            <td class="table_subheadercell" style="width:140px "><h:outputText value="TC Nội bộ" escape="false"/></td>
                                            <td class="table_subheadercell" style="width:140px "><h:outputText value="TC bên ngoài" escape="false"/></td>
                                            <td class="table_subheadercell" style="width:90px "><h:outputText value="Điện thoại" escape="false"/></td>
                                            <td class="table_subheadercell" style="width:200px "><h:outputText value="Email" escape="false"/></td>
                                            <td class="table_subheadercell" style="width:250px "><h:outputText value="Địa chỉ" escape="false"/></td>
                                            <td class="table_subheadercell" style="width:250px "><h:outputText value="Mô tả" escape="false"/></td>
                                            <td class="table_subheadercell" style="width:80px "><h:outputText value="Ngày hiệu lực" escape="false"/></td>
                                            <td class="table_subheadercell" style="width:80px "><h:outputText value="Ngày lập HĐ" escape="false"/></td>
                                            <td class="table_subheadercell" style="width:250px "><h:outputText value="Ngày kiềm tra" escape="false"/></td>
                                            <td class="table_subheadercell" style="width:250px "><h:outputText value="Ngày xác nhận" escape="false"/></td>
                                            <td class="table_subheadercell" style="width:250px "><h:outputText value="Ngày cập nhật" escape="false"/></td>
                                        </tr>
                                    </table>
                                    <%-- content --%>
                                    <div style="float:left; height: auto; max-height: 600px !important; width:100%; overflow-x:hidden; overflow-y:auto;"> 
                                        <table>
                                            <h:inputHidden value="#{T950Bean.FT950CN}" id="FT950CN"/>
                                            <a4j:repeat value="#{T950Bean.listT950CN}" var="item" rowKeyVar="index">  
                                                <tr class="table_row" lang="<h:outputText value="#{item.pt950}"/>">
                                                    
                                                        <td class="table_cell cssCenter  <h:outputText rendered="#{index%2 !=0 && item.ht1 == null && item.ht == null}"  value="odd"/> <h:outputText rendered="#{item.ht1 != null && item.ht != null}"  value="add_fis1"/> <h:outputText rendered="#{item.ht1 == null && item.ht != null}"  value="add_fis"/>" style="width: 40px">

                                                            <h:graphicImage rendered="#{loginSession.right.DEB_LST_ITEM}" value="../images/history.png" height="15px" width="15px" alt="view" title="Xem" styleClass="predebt predebt#{item.pt950}" lang="#{item.pt950}">                                                            
                                                            </h:graphicImage>

                                                        </td>
                                                    
                                                    <td class="table_cell cssCenter  <h:outputText rendered="#{index%2 !=0 && item.ht1 == null && item.ht == null}"  value="odd"/> <h:outputText rendered="#{item.ht1 != null && item.ht != null}"  value="add_fis1"/> <h:outputText rendered="#{item.ht1 == null && item.ht != null}"  value="add_fis"/>" style="width: 42px">

                                                        <h:panelGroup rendered="#{loginSession.right.DEB_LST_MOD}">
                                                            <div style="width:20px;float: left;">
                                                                <h:outputLink rendered="#{item.ht == null}"  value="financialInputCN.jsp?action=editCN&pt950=#{item.pt950}&pn100=#{item.fn100}&page=debt1.jsp&height=282px&width=345px" styleClass="fancybox add_new" id="fancybox3">
                                                                    <img src="../images/edit.png" alt="edit" title="edit"/>
                                                                </h:outputLink>

                                                            </div>
                                                        </h:panelGroup>
                                                        <h:panelGroup rendered="#{loginSession.right.DEB_LST_DEL}">
                                                            <div style="width:20px; float: right;">
                                                                <h:outputLink value="deleteFinancial.jsp?action=delete&pt950=#{item.pt950}&page=debt.jsp&height=282px&width=345px" styleClass="fancybox add_new" id="fancybox4">
                                                                    <img src="../images/delete_1.png" alt="delete"  title="delete" />
                                                                </h:outputLink>

                                                            </div>
                                                        </h:panelGroup>

                                                    </td>
                                                    <td class="table_cell cssCenter  <h:outputText rendered="#{index%2 !=0 && item.ht1 == null && item.ht == null}"  value="odd"/>  <h:outputText rendered="#{item.ht1 != null && item.ht != null}"  value="add_fis1"/> <h:outputText rendered="#{item.ht1 == null && item.ht != null}" value="add_fis" />" style="width: 60px">

                                                        <h:outputLink rendered="#{loginSession.right.DEB_LST_CRECN}"  style="margin-top: 5px;"  value="adddebt.jsp?action=editCNL&pt950=#{item.pt950}&page=debt.jsp&height=282px&width=345px" styleClass="fancybox add_new" id="fancybox11111">
                                                            <img  src="../images/add_tab.png" height="15px" width="15px" title="Thanh toán"/> 
                                                        </h:outputLink>

                                                    </td>
                                                    <td class="table_cell cssCenter  <h:outputText rendered="#{index%2 !=0 && item.ht1 == null && item.ht == null}"  value="odd"/> <h:outputText rendered="#{item.ht1 != null && item.ht != null}"  value="add_fis1"/> <h:outputText rendered="#{item.ht1 == null && item.ht != null}" value="add_fis" />" style="width: 50px">

                                                        <h:outputLink  rendered="#{loginSession.right.DEB_LST_DOC}" style="margin-top: 5px;"  value="uploadfile.jsp?pc150=&page=debt.jsp&type=ALL&table=T950CN&KeepThis=true&amp;TB_iframe=true&amp;height=350&amp;width=550&amp;modal=true" styleClass="thickbox add_new">
                                                            <img  src="../images/docs_icon.png" height="15px" width="15px" title="Add document"/> 
                                                        </h:outputLink>
                                                        <h:outputLink rendered="#{loginSession.right.DEB_LST_VIEWDOC}"  value="viewdocumentT950.jsp?action=documentCN&height=282px&width=345px" styleClass="fancybox add_new" id="fancybox9">
                                                            <img src="../images/eye.png" alt="view" style="width:20px;height:12px;padding-left:4px;" title="view" />
                                                        </h:outputLink>

                                                    </td>
                                                    <td class="table_cell cssCenter  <h:outputText rendered="#{index%2 !=0 && item.ht1 == null && item.ht == null}"  value="odd"/> <h:outputText rendered="#{item.ht1 != null && item.ht != null}"  value="add_fis1"/> <h:outputText rendered="#{item.ht1 == null && item.ht != null}" value="add_fis "/>" style="width: 60px">

                                                        <h:panelGroup rendered="#{loginSession.right.DEB_LST_DKD}">
                                                            <h:outputLink disabled="#{item.flagforT9501}" rendered="#{item.ht == null}"  value="confirm.jsp?pt950=#{item.pt950}&table=flau&page=debt.jsp&height=150px&width=300px" styleClass="fancybox card_delete" >
                                                                <img  src="../images/check_alt.png" alt="Kiểm duyệt" style="padding-right:6px;"  title="Kiểm duyệt" />                                               
                                                            </h:outputLink>
                                                            <h:outputLink disabled="true" rendered="#{item.ht != null}"  value="confirm.jsp?pt950=#{item.pt950}&table=flau&page=debt.jsp&height=150px&width=300px" styleClass="fancybox card_delete" >
                                                                <img  src="../images/check_false.png" alt="Kiểm duyệt"  title="Kiểm duyệt" />                                               
                                                            </h:outputLink>

                                                        </h:panelGroup>
                                                        <h:panelGroup rendered="#{loginSession.right.DEB_LST_DXN}">
                                                            <h:outputLink disabled="#{item.flagforT950}"  rendered="#{item.ht1 == null}" value="confirm.jsp?pt950=#{item.pt950}&table=appro&page=debt.jsp&height=150px&width=300px" styleClass="fancybox card_delete" >
                                                                <img  src="../images/tick_circle.png" alt="Xác nhận" title="Xác nhận" />                                               
                                                            </h:outputLink>
                                                            <h:outputLink disabled="true" rendered="#{item.ht1 != null}"  value="confirm.jsp?pt950=#{item.pt950}&table=flau&page=debt.jsp&height=150px&width=300px" styleClass="fancybox card_delete" >
                                                                <img  src="../images/check_false.png" alt="Xác nhận"  title="Xác nhận" />                                               
                                                            </h:outputLink>
                                                        </h:panelGroup>

                                                    </td>
                                                    <td class="table_cell   <h:outputText rendered="#{index%2 !=0 && item.ht1 == null && item.ht == null}"  value="odd"/> <h:outputText rendered="#{item.ht1 != null && item.ht != null}"  value="add_fis1"/> <h:outputText rendered="#{item.ht1 == null && item.ht != null}" value="add_fis"/>" style="width: 70px">

                                                        <h:outputText value="#{item.tv001}"/>

                                                    </td>
                                                    <td class="table_cell cssCenter  <h:outputText rendered="#{index%2 !=0 && item.ht1 == null && item.ht == null}"  value="odd"/> <h:outputText rendered="#{item.ht1 != null && item.ht != null}"  value="add_fis1"/> <h:outputText rendered="#{item.ht1 == null && item.ht != null}" value="add_fis"/>" style="width: 100px">

                                                        <h:outputText value="#{item.bv051}"/> 

                                                    </td>
                                                    <td class="table_cell cssRight  <h:outputText rendered="#{index%2 !=0 && item.ht1 == null && item.ht == null}"  value="odd"/> <h:outputText rendered="#{item.ht1 != null && item.ht != null}"  value="add_fis1"/> <h:outputText rendered="#{item.ht1 == null && item.ht != null}" value="add_fis"/>" style="width: 100px">

                                                        <h:outputText value="#{item.tn951st}"/>   

                                                    </td>
                                                    <td class="table_cell cssCenter  <h:outputText rendered="#{index%2 !=0 && item.ht1 == null && item.ht == null}"  value="odd"/> <h:outputText rendered="#{item.ht1 != null && item.ht != null}"  value="add_fis1"/> <h:outputText rendered="#{item.ht1 == null && item.ht != null}" value="add_fis"/>" style="width: 50px">

                                                        <h:outputText value="#{item.money}"/> 

                                                    </td>
                                                    <td class="table_cell   <h:outputText rendered="#{index%2 !=0 && item.ht1 == null && item.ht == null}"  value="odd"/> <h:outputText rendered="#{item.ht1 != null && item.ht != null}"  value="add_fis1"/> <h:outputText rendered="#{item.ht1 == null && item.ht != null}" value="add_fis"/>" style="width: 140px">
                                                        <h:outputLink value="customer.jsp?pnPN100=#{item.fn100}"> <h:outputText value="#{item.hoten}" /></h:outputLink>

                                                        </td>
                                                        <td class="table_cell   <h:outputText rendered="#{index%2 !=0 && item.ht1 == null && item.ht == null}"  value="odd"/> <h:outputText rendered="#{item.ht1 != null && item.ht != null}"  value="add_fis1"/> <h:outputText rendered="#{item.ht1 == null && item.ht != null}" value="add_fis"/>" style="width: 140px">
                                                        <h:outputText value="#{item.tv969}" />

                                                    </td>
                                                    <td class="table_cell   <h:outputText rendered="#{index%2 !=0 && item.ht1 == null && item.ht == null}"  value="odd"/> <h:outputText rendered="#{item.ht1 != null && item.ht != null}"  value="add_fis1"/> <h:outputText rendered="#{item.ht1 == null && item.ht != null}" value="add_fis"/>" style="width: 140px">
                                                        <h:outputText value="#{item.tv970}" />

                                                    </td>
                                                    <td class="table_cell   <h:outputText rendered="#{index%2 !=0 && item.ht1 == null && item.ht == null}"  value="odd"/> <h:outputText rendered="#{item.ht1 != null && item.ht != null}"  value="add_fis1"/> <h:outputText rendered="#{item.ht1 == null && item.ht != null}" value="add_fis"/>" style="width: 140px">
                                                        <h:outputText value="#{item.tv957}" />

                                                    </td>
                                                    <td class="table_cell   <h:outputText rendered="#{index%2 !=0 && item.ht1 == null && item.ht == null}"  value="odd"/> <h:outputText rendered="#{item.ht1 != null && item.ht != null}"  value="add_fis1"/> <h:outputText rendered="#{item.ht1 == null && item.ht != null}" value="add_fis"/>" style="width: 140px">
                                                        <h:outputText value="#{item.tv958}" />

                                                    </td>
                                                    <td class="table_cell cssCenter  <h:outputText rendered="#{index%2 !=0 && item.ht1 == null && item.ht == null}"  value="odd"/> <h:outputText rendered="#{item.ht1 != null && item.ht != null}"  value="add_fis1"/> <h:outputText rendered="#{item.ht1 == null && item.ht != null}" value="add_fis"/>" style="width: 90px">

                                                        <h:outputText value="#{item.nv107}"/> 

                                                    </td>
                                                    <td class="table_cell   <h:outputText rendered="#{index%2 !=0 && item.ht1 == null && item.ht == null}"  value="odd"/> <h:outputText rendered="#{item.ht1 != null && item.ht != null}"  value="add_fis1"/> <h:outputText rendered="#{item.ht1 == null && item.ht != null}" value="add_fis"/>" style="width: 200px">

                                                        <h:outputText value="#{item.nv105}"/>

                                                    </td>
                                                    <td class="table_cell   <h:outputText rendered="#{index%2 !=0 && item.ht1 == null && item.ht == null}"  value="odd"/> <h:outputText rendered="#{item.ht1 != null && item.ht != null}"  value="add_fis1"/> <h:outputText rendered="#{item.ht1 == null && item.ht != null}" value="add_fis"/>" style="width: 250px">

                                                        <h:outputText value="#{item.nv112}"/>

                                                    </td>
                                                    <td class="table_cell   <h:outputText rendered="#{index%2 !=0 && item.ht1 == null && item.ht == null}"  value="odd"/> <h:outputText rendered="#{item.ht1 != null && item.ht != null}"  value="add_fis1"/> <h:outputText rendered="#{item.ht1 == null && item.ht != null}" value="add_fis"/>" style="width: 250px">

                                                        <h:outputText value="#{item.tv971}"/> 

                                                    </td>
                                                    <td class="table_cell cssCenter  <h:outputText rendered="#{index%2 !=0 && item.ht1 == null && item.ht == null}"  value="odd"/> <h:outputText rendered="#{item.ht1 != null && item.ht != null}"  value="add_fis1"/> <h:outputText rendered="#{item.ht1 == null && item.ht != null}" value="add_fis"/>" style="width: 80px">

                                                        <h:outputText value="#{item.td954}"> <f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText> 

                                                        </td>
                                                        <td class="table_cell cssCenter  <h:outputText rendered="#{index%2 !=0 && item.ht1 == null && item.ht == null}"  value="odd"/> <h:outputText rendered="#{item.ht1 != null && item.ht != null}"  value="add_fis1"/> <h:outputText rendered="#{item.ht1 == null && item.ht != null}" value="add_fis"/>" style="width: 80px">

                                                        <h:outputText value="#{item.td953}"><f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText> 

                                                        </td>
                                                        <td class="table_cell cssCenter  <h:outputText rendered="#{index%2 !=0 && item.ht1 == null && item.ht == null}"  value="odd"/> <h:outputText rendered="#{item.ht1 != null && item.ht != null}"  value="add_fis1"/> <h:outputText rendered="#{item.ht1 == null && item.ht != null}" value="add_fis"/>" style="width: 250px">

                                                        <h:outputText value="#{item.td964St}"><f:convertDateTime type="TIMESTAMP" pattern="dd/MM/yyyy HH:mm:ss" /> </h:outputText></br>
                                                        <h:outputText value="#{item.ht}"/> 

                                                    </td>
                                                    <td class="table_cell cssCenter  <h:outputText rendered="#{index%2 !=0 && item.ht1 == null && item.ht == null}"  value="odd"/> <h:outputText rendered="#{item.ht1 != null && item.ht != null}"  value="add_fis1"/> <h:outputText rendered="#{item.ht1 == null && item.ht != null}" value="add_fis"/>" style="width: 250px">
                                                        <h:outputText value="#{item.td966St}"/> </br>
                                                        <h:outputText value="#{item.ht1}"/>
                                                    </td>
                                                    <td class="table_cell cssCenter  <h:outputText rendered="#{index%2 !=0 && item.ht1 == null && item.ht == null}"  value="odd"/> <h:outputText rendered="#{item.ht1 != null && item.ht != null}"  value="add_fis1"/> <h:outputText rendered="#{item.ht1 == null && item.ht != null}" value="add_fis"/>" style="width: 230px">

                                                        <h:outputText value="#{item.tl998}"/> </br>
                                                        (<h:outputText value="#{item.tl999}"/>)

                                                    </td>                                            
                                                </tr>
                                                <tr>
                                                    <td  colspan="19">
                                                        <h:panelGroup  styleClass="debtContent" >
                                                        </h:panelGroup>
                                                    </td>
                                                </tr>
                                            </a4j:repeat>
                                        </table>
                                    </div>    
                                    <%--end content ---%>
                                </div>
                            </h:panelGroup>
                            <h:panelGroup rendered="#{T950Bean.idtype != 0}">

                                <rich:dataTable value="#{T950Bean.listT950CNKH}" var="cus"
                                                rows="50"
                                                rowClasses="greyRow, whiteRow"

                                                width="926px" columnClasses=",columns,columns,columns" rowKeyVar="row"
                                                id="table" styleClass="machinePosDataTable">

                                    <rich:column style="width:30px; text-align:center">
                                        <f:facet name="header">
                                            <h:outputText value="Action"/>
                                        </f:facet>
                                        <h:outputLink  style="margin-top: 5px;"  value="adddebt.jsp?action=editCNKH&pn100=#{cus.pn100}&page=debt.jsp&height=282px&width=345px" styleClass="fancybox add_new" id="fancybox11112">
                                            <img  src="../images/add_tab.png" height="15px" width="15px" title="Thêm công nợ"/> 
                                        </h:outputLink>
                                    </rich:column>
                                    <rich:column style="width:140px;">
                                        <f:facet name="header">
                                            <h:outputText value="#{locale.frist_lastname}" />
                                        </f:facet>
                                        <div style="width:140px;margin-left: 5px;">
                                            <h:outputLink value="customer.jsp?pnPN100=#{cus.pn100}&type=#{cus.ni104}"> <h:outputText value="#{cus.hoten}" /></h:outputLink>
                                            </div>
                                    </rich:column>

                                    <rich:column width="80px">
                                        <f:facet name="header">
                                            <h:outputText value="#{locale.identification}" />
                                        </f:facet>

                                        <div style="width:80px;margin-left: 5px;">
                                            <h:outputText value="#{cus.nv109}" />
                                        </div>
                                    </rich:column>


                                    <rich:column  width="160px" styleClass="email">
                                        <f:facet name="header">
                                            <h:outputText value="#{locale.email}" />
                                        </f:facet>

                                        <div style="width:160px;margin-left: 5px;">

                                            <h:outputLink value="popupSendMailPerson.jsp?page=customerexpand&idx=#{cus.pn100}&mailx=#{cus.nv105}&typex=customerexpand&KeepThis=true&amp;TB_iframe=true&amp;height=653&amp;width=741&amp;modal=true" styleClass="thickbox add_new" id="thickbox3"  ><h:outputText value="#{cus.nv105}" /></h:outputLink>
                                            </div>
                                    </rich:column>
                                    <rich:column  width="80px">
                                        <f:facet name="header">
                                            <h:outputText value="#{locale.telephone}" />
                                        </f:facet>

                                        <div style="width:80px;margin-left: 5px;">
                                            <a href="sendSMS.jsp?action=sendSMS&hoten=<h:outputText value="#{cus.hoten}" />&pn100=<h:outputText value="#{cus.pn100}" />&phone=<h:outputText value="#{cus.nv958}" />" class="fancybox actionsendsms"> <h:outputText value="#{cus.nv958}" styleClass="phone" lang="#{cus.nv958}"/> </h2> <h:outputText rendered="#{cus.nv958=='' ||  cus.nv958== null}" value="<br/>" escape="false"/></a></h2>

                                        </div>
                                    </rich:column>
                                    <rich:column  width="120px">
                                        <f:facet name="header">
                                            <h:outputText value="#{locale.company}" />
                                        </f:facet>

                                        <div style="width:120px;margin-left: 5px;">
                                            <h:outputLink value="cuscompany.jsp?pnPK100=#{cus.fk100}&type=#{cus.kn114}"><h:outputText value="#{cus.kv103}" /></h:outputLink>
                                            </div>
                                    </rich:column>


                                    <rich:column  style="width:160">
                                        <f:facet name="header">
                                            <h:outputText value="#{locale.address}" />
                                        </f:facet>
                                        <div style="width:160;margin-left: 5px;">
                                            <h:outputText value="#{cus.nv112}" />
                                        </div>

                                    </rich:column>

                                </rich:dataTable>

                            </h:panelGroup>

                            <rich:modalPanel id="ajaxLoadingModalBox" minHeight="30" minWidth="40"
                                             height="30" width="40" zindex="2000">
                                <h:outputText value="#{locale.please_wait}" styleClass="startDummer"></h:outputText>
                            </rich:modalPanel>

                            <h:inputHidden value="#{T950Bean.flag}" />




                        </div>
                    </div>
                </div>


            </a4j:form>

    </body>
</html>


        <style type="text/css">
            #main{
width:100%;
}
#content{
padding:0px !important;
width:100%;
}
#footer{
width:100%;
}
.title_tour{
width:100%;
}

#content_detail {
    float: left;
    padding-left: 10px;
    padding-right: 10px;
    width: 98.5%;
}


#header_content {
    float: right;
    margin-top: 40px;
    width: 87%;
}
            .debtContent{
                border-bottom: 1px solid #C4C0C9;
                width: 3181px;
                background-image: -moz-linear-gradient(59% 55% 90deg, #DADDDE, #FFFFFF);
                background-image:-webkit-gradient(linear, 0 0%, 0 50%, from(#FFFFFF), to(#DADDDE));
                box-shadow:#BEC2C4 0 1px 2px;
                /*   background-image: -moz-linear-gradient(19% 75% 90deg, #BEC2C4, #FFFFFF);
                  background-image:-webkit-gradient(linear, 0 0%, 0 100%, from(#FFFFFF), to(#BEC2C4))
                  background:#FAF6D1; */
            }
            .odd {
                background: none repeat scroll 0 0 #E0EFFC;
            }


            .rich-dtascroller-table {
                background-color: #FFFFFF;
                border-color: #82A6C7;
                float: right;
                margin-right: 0 !important;
                margin-top: 10px !important;
            }
            .rich-table-cell 
            {
                border-bottom: 1px solid #C4C0C9;
                border-right: 1px solid #C4C0C9 ;
                color: #000000;
                font-family: Arial,Verdana,sans-serif;
                font-size: 11px;
                padding: 0px !important;
            }
            .content .scrolls{
                width:800px !important;
                float:left;

                overflow:auto;
            }
            .content .rich-table{
                width:800px !important;
                float:left;

                overflow:auto;
            }
            .content table{
                width:800px !important;
                float:left;
            }
            .content_table {
                width:100% !important;
                float:left;

                overflow:auto;
            }

            .text_center{
                text-align: center;
            }
            .text_right{
                text-align: right;
            }
            .fieldset, img {
                border: 0 none;

            }
            .date_test{
                height: 32px;
                width:135px;
                text-align: center;
            }
            .loaigd{

                width:134px;
                padding: 9px;
                height: 14px;


            }
            .loaigdaa{

                width:282px;
                padding: 9px;
                height: 14px;


            }
            .hoten{

                width:150px;
                padding: 9px;
                height: 14px;


            }
            .matour{
                padding: 9px;
                width:81px;
                height: 14px;
            }
            .tongchiphi{
                padding: 9px;
                width:100px;
                height: 14px;
            }
            .tiente{
                padding: 9px;
                width:23px;
                height: 14px;
            }
            .status{
                padding: 9px;
                text-align: center;
                width:22px;
                height: 14px;
            }
            .mota{
                padding: 9px;
                width:215px;
                height: 14px;
            }
            .ngayhieuluc{
                padding: 9px;
                width:58px;
                text-align: center;
                height: 14px;
            }
            .ngaylap{
                padding: 9px;
                width:57px;
                text-align: center;
                height: 14px;
            }
            .ngayxacnhan{
                height: 32px;
                text-align: center;
                width:135px;
            }

            .kiemduyet{
                text-align: center;
                width:63px;
                height: 32px;
            }
            .ngaycapnhat{
                padding: 9px;
                text-align: center;
                width: 128px;
                height: 14px;
            }
            .sua{
                height: 32px;
                text-align: center;
                width:60px;
            }
            .tailieu{
                width:55px;
                text-align: center;
                height: 32px;
            }

            .feild_sex td label{width: 150px !important; color:white; font-size:12px; text-transform: none; margin-left:3px;}

            .buttonsearch2{
                border:0;
                background:url(../images/bg_submit.gif) repeat-x;
                width:68px;

                margin:0px 0 10px 20px;
                color:#ffffff;
                font-size:12px;
                font-weight:bold;
                cursor:pointer;
                border-radius:2px;
                padding:4px 0;
                text-transform:uppercase;
            }
            input{
                float:left;
                margin-left:9px;
            }
            select{
                float:left;
                height: 21px;
                width:70px;
                margin-left:9px;
            }
            .add{
                width: 50px;
                margin-top:3px;
                display: none;
            }
            .add input[type="text"]
            {
                width: 102px !important;
                height:20px !important;
                margin-right: 5px;
            }
            .add img
            {
                margin-top: 4px !important;
            }
            .date{
                float: left;
                margin-top:3px;
                margin-left: 7px;
            }
            .date1{
                float: left;
                margin-top:3px;
                margin-left: 7px;
            }
            .closeGroup{
                float: right;
                font-size: 14px;
                margin-right: 5px;
                width:150px;
                height:auto;
                position:absolute;
                background: #2B3844;
                color:white !important;
                top:30px;
                display:none;
                text-align: right;
            }
            .greyRow{
                background: #E0EFFC;
            }
            .whiteRow{
                background: #ffffff;
            }
            .white{
                background: #FFFFFF;
            }
            .blue{
                background: #E0EFFC;
            }
            .fillter{
                margin-top: 15px !important;
                height: 15px !important;
            }
            .viewTable{
                width: 3181px;
            }
            .add_fis{
                background-color: #E6E9EB;
            }
            .add_fis1{
                background-color: #BBBDBF; 
                /* background-color: #b2b7bb;*/
            }
            .predebt{
                cursor: pointer;
            }
            .closeGroup{
                z-index: 999;
            }
            .group{
                z-index: 999;
            }
            .rich-table-row{
                height: 32px !important;
            }
        </style>